package com.ysh.ioc.component;


import com.ysh.ioc.model.Student;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {
    @Bean({"s3","s4"})
    public Student s1(){
        return new Student("zhangsan",11);
    }
    /*@Bean
    public String name(){
        return "lisi";
    }*/
    //@Primary
    @Bean
    public Student s2(){
        return new Student("lisi",12);
    }
    @Bean
    private String name(){
        return "lisi1";
    }
    @Bean
    private String name2(){
        return "lisi2";
    }
    @Bean
    private String name3(){
        return "wangwu";
    }
    @Bean
    public Student s5(@Qualifier("name3") String n){
        return new Student(n,18);
    }
    @Bean
    public Integer num1(){
        return Integer.valueOf(10);
    }
    /*@Bean
    public Student s2(){
        return new Student("lisi",12);
    }*/
}
